<!DOCTYPE html>
<html>
<script src="./resources/test-runner-paint-worklet.js"></script>
<style>
html, body { margin: 0; padding: 0; }
#output {
    width: 200px;
    height: 200px;
    background-image: paint(worklet);
}
</style>
<body>
<div id="output"></div>

<script id="code" type="text/worklet">
registerPaint('worklet', class {
    paint(ctx, geom) {
        ctx.fillStyle = 'green';
        ctx.fillRect(0, 0, 20, 20);
        ctx.fillRect(180, 0, 20, 20);
        ctx.fillRect(0, 180, 20, 20);
        ctx.fillRect(180, 180, 20, 20);
    }
});
</script>

<script>
    document.body.style.zoom = "50%";
    importPaintWorkletThenEndTest(document.getElementById('code').textContent);
</script>
</body>
</html>
